package com.heima.search.controller;


import com.heima.common.dto.ResponseResult;
import com.heima.search.dto.ApArticleSearchDto;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.heima.search.service.IApUserSearchService;


import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * APP用户搜索信息表 前端控制器
 * </p>
 *
 * @author mcm
 * @since 2021-07-27
 */
@RestController
@RequestMapping("/api/v1/history")
@Api(tags = "APP用户搜索信息表接口")
public class ApUserSearchController {

    @Autowired
    private IApUserSearchService apUserSearchService;

    /**
     * 加载搜索记录
     *
     * @param dto
     * @return
     */
    @PostMapping("/load")
    public ResponseResult load(@RequestBody ApArticleSearchDto dto) {
        return apUserSearchService.load(dto);
    }

    /**
     * 删除搜索记录
     *
     * @param dto
     * @return
     */
    @PostMapping("/del")
    public ResponseResult delete(@RequestBody ApArticleSearchDto dto) {
        return apUserSearchService.delete(dto);
    }
}
